package org.ehe.business.step.test;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * PDF测试
 * @author :zhangnn
 * @className :PDFTestController
 * @description: TODO
 * @date 2025-08-06 09:43:59
 */
@Slf4j
@RestController
@RequestMapping("/step/test")
public class PDFTestController {
    @Autowired
    private PDFTestFixture pdfTestFixture;

    /**
     * 手动测试PDF生成
     * 可以通过REST接口或直接调用测试
     */
    @GetMapping("/pdf")
    public String testPDFGeneration() {
        // 诊断问题
        pdfTestFixture.diagnosePDFIssues();

        // 打印修复建议
        pdfTestFixture.printFixSuggestions();

        // 生成测试PDF
        return pdfTestFixture.generateTestPDF();
    }
}
